package article

import (
	"go-gin-api/app/model"
	"go-gin-api/app/util"

	"github.com/gin-gonic/gin"
)

// GetType 获取类型
func GetType(c *gin.Context) *util.Response {
	s := make([]*model.ArticleType, 0)
	err := model.DB.Find(&s).Error
	if err != nil {
		return &util.Response{
			Code:    4000,
			Message: "failed",
			Data:    "查询文章分类失败!",
		}
	}
	return &util.Response{
		Code:    200,
		Message: "success",
		Data:    s,
	}
}
